package com.zing.network.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zing.network.R;
import com.zing.network.net.ProjectBean;

import java.util.List;

/**
 * @author jichang
 * @date 2018/9/19 21:59
 * email: 2218982471@qq.com
 * describ:
 */
public class MyAdapter2 extends BaseQuickAdapter<ProjectBean.DataBean.DatasBean, BaseViewHolder> {

    public MyAdapter2(int layoutResId, @Nullable List<ProjectBean.DataBean.DatasBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ProjectBean.DataBean.DatasBean item) {
        Glide.with(mContext).load(item.getEnvelopePic()).into((ImageView) helper.getView(R.id.image_simple));
        helper.setText(R.id.tv_title, item.getTitle());
        helper.setText(R.id.tv_content, item.getDesc());
        helper.setText(R.id.tv_time,item.getNiceDate());
        helper.setText(R.id.tv_author,item.getAuthor());
    }
}
